package pers.brozen.anka.controller;

import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.brozen.anka.apis.params.gallery.GetGalleryDetailParam;
import pers.brozen.anka.apis.params.gallery.GetGalleryPageParam;
import pers.brozen.anka.apis.vos.GalleryDetailVo;
import pers.brozen.anka.apis.vos.GalleryListItemVo;
import pers.brozen.anka.apis.vos.PageVo;
import pers.brozen.anka.service.GalleryService;
import pers.brozen.anka.support.web.response.Response;

/**
 * @author Brozen
 * @since 2024-05-28
 */
@RestController
@RequestMapping("/api/gallery")
public class GalleryController {

    @Resource
    private GalleryService galleryService;


    @GetMapping("/page")
    public Response<PageVo<GalleryListItemVo>> getGalleryPage(@Valid GetGalleryPageParam param) {
        return Response.ofSuccess(galleryService.getPage(param));
    }



    @GetMapping("/detail")
    public Response<GalleryDetailVo> getGalleryDetail(@Valid GetGalleryDetailParam param) {
        return Response.ofSuccess(galleryService.getGalleryDetail(param));
    }




}
